import request from '../utils/request'

export function getDepartment () {
  return request({
    url: '/company/department',
    method: 'get'
  })
}

// 获取添加部门里的下拉列表的员工信息
export function getManagerList () {
  return request({
    url: '/sys/user/simple'
  })
}

// 添加部门
export function addDepartment (data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}
// 获取部门详情
export function getDepartmentDetail (id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 修改部门
export function updateDepartment (data) {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
// 删除部门
export function deleteDepartment (id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
